<template>
	<sc-water-mark ref="wm" :text="waterMarkContent" :subtext="waterMarkSubtext" :showWater="waterMark=='1'">
	<el-main>
		<el-form :model="search" label-width="100px" label-position="left">
		<el-form-item label="收文标题" prop="title">
			<el-input v-model="search.title" placeholder="收文标题" clearable style="width: 100%;"></el-input>
		</el-form-item>
		<el-form-item label="流水号" prop="id">
			<el-input-number v-model="search.id" placeholder="流水号" clearable style="width: 100%;"></el-input-number>
		</el-form-item>
		<el-form-item label="发起人" prop="createUser">
			<select-user-dialog v-model:accountId="search.createUser" :mode="false"/>
		</el-form-item>
		<el-form-item label="收文名称" prop="flowId">
			<el-select v-model="search.flowId" style="width: 100%;">
				<el-option value="" label="全部"></el-option>
				<el-option v-for="item in flowOptions" :key="item.value" :value="item.value" :label="item.label"></el-option>
			</el-select>
		</el-form-item>
		<el-form-item label="收文状态" prop="status">
			<el-select v-model="search.status" style="width: 100%;">
				<el-option value="" label="全部"></el-option>
				<el-option value="1" label="过程中"></el-option>
				<el-option value="2" label="已结束"></el-option>
			</el-select>
		</el-form-item>
		<el-form-item label="查询范围" prop="manageRange">
			<el-select v-model="search.manageRange" style="width: 100%;">
				<el-option value="0" label="全部"></el-option>
				<el-option value="1" lable="我经办的"></el-option>
				<el-option value="2" label="可查询的"></el-option>
			</el-select>
		</el-form-item>
		</el-form>
		<div>
			<el-button type="primary" style="width: 100%" @click="searchList">查询</el-button>
		</div>
	</el-main>
	</sc-water-mark>
</template>
<script>
import selectUserDialog from "@/views/module/selectUserDialog";
export default {
	components: {
		selectUserDialog
	},
	data() {
		return {
			flowOptions:[],
			search: {
				title:'',
				createUser:'',
				id:null,
				flowId:'',
				status:'',
				manageRange:'0'
			},
			waterMarkContent:'',
			waterMarkSubtext:'',
			waterMark:'0',
		}
	},
	mounted() {
		this.waterMark = this.$TOOL.data.get("WATER_MARK");
		this.waterMarkContent = this.$TOOL.data.get("WATER_MARK_CONTENT");
		this.waterMarkSubtext = this.$TOOL.data.get("WATER_MARK_SUBTEXT");
		this.getBpmFlowListForSearch();
	},
	methods: {
		searchList(){
			this.$nextTick(() => {
				this.$router.replace({
					path: '/app/doc/rev/search/list',
					query:this.search
				})
			})
		},
		async getBpmFlowListForSearch() {
			var res = await this.$API.bpm.bpmFlow.getBpmFlowListForSearch.get({model:'1',isDoc:'2'});
			if (res.code == 200) {
				this.flowOptions=res.data;
			} else {
				this.$alert(res.message, "提示", {type: 'error'})
			}
		},
	}
}
</script>
<style scoped>
</style>
